<template>
  <div class="top">
    <div class="header">
      <div class="logo">
        <img src="@/assets/loginImgs/logo.png" alt="">
      </div>
      <div>
        <router-link :class="{ active: path === '/home/first' || path === '/home'}" to="/home">
          Home
        </router-link>
        <router-link to="/marketing"> Martket </router-link>
        <router-link :class="{ active: path === '/home/college' || path === '/home/collegeDetial' || path === '/home/collegeLearn' }" to="/home/college"> College </router-link>
        <router-link :class="{ active: path === '/home/news' || path === '/home/newsDetial' }" to="/home/news">
          News
        </router-link>
        <router-link :class="{ active: path === '/home/faq' }" to="/home/faq"> FAQ </router-link>
        <router-link :class="{ active: path === '/home/login' }" to="/home/login">
          Login
        </router-link>
        <router-link :class="{ active: path === '/home/register' }" to="/home/register"> Start for free </router-link>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      path: ''
    };
  },
  watch: {
    $route(to, from) {
      this.path = to.path;
    }
  },
  mounted() {
    this.$forceUpdate();
    this.path = this.$route.path;
  },
  methods: {}
};
</script>
<style lang="scss" scoped>
.top {
  width: 100%;
  position: fixed;
  top: 0;
  height: 70px;
  z-index: 100;
  font-family: Segoe UI;
  text-align: center;
  line-height: 70px;
  background: #ffff;
      box-shadow: 0 calc(100vw / 1920) calc(100vw / 200) rgba(0, 0, 0, 0.2);
}
.header {
  width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  .logo {
    width: 250px;
    height: 40px;
    margin-top: 15px;
    img {
      width: 100%;
      height: 100%;
    }
  }
  a {
    font-size: 18px;
    margin: 0 30px;
  }
  .active {
    color: #02a152;
    // padding: calc(100vw / 27.42 / 2.9) calc(100vw / 27.42 / 2.9) calc(100vw / 120) calc(100vw / 27.42 / 2.9);
    // background: rgba(2, 161, 82, 1);
    opacity: 1;
    // margin: 0;
    border-radius: 0px 0px 4px 4px;
  }
}
</style>
